<template>
    <div id="content">
        <el-row :gutter="10" class="chart_top">
            <el-col :span="24">
                <el-card shadow="always" :style="{width:'100%',height:autoHeight+'px'}">
                        <el-row class="data_box" style="position:absolute;top:2px;right:10px;z-index:1999;">
                                <el-date-picker
                                v-model="search.year"
                                type="year"
                                value-format="yyyy"
                                @change="showGanttMapStartTime"
                                placeholder="开始日期">
                                </el-date-picker>
                                <el-radio v-model="search.type" :label="1" @change="radioChangeForLayerOne">季度</el-radio>
                                <el-radio v-model="search.type" :label="2" @change="radioChangeForLayerOne" style="margin-left:-10px; margin-right:10px;">月份</el-radio>
                        </el-row>
                        <el-row>
                            <br>
                        <div id="barDiv" style="width:100%;height:800px;border:0px solid red;"></div>

                        </el-row>
                </el-card>
            </el-col>
            <!-- <el-col :span="12">
                <el-card shadow="always" :style="{width:'100%',height:autoHeight+'px'}">
                    <div style="position: relative;">
                        <div id="ed">1231231</div>
                    </div>
                </el-card>
            </el-col>
            <el-col :span="12">
                <el-card shadow="always" :style="{width:'100%',height:autoHeight+'px'}">
                    <div style="position: relative;">
                        <div id="ed">1231231</div>
                    </div>
                </el-card>
            </el-col> -->
        </el-row>
        <!-- <div id="barDiv"></div> -->
        <el-dialog :title="dialog.weekBar.title" :visible.sync="dialog.weekBar.isShow" :close-on-click-modal="false" width="100%" top="10px"  v-dialogDrag>
            <el-row :gutter="10" class="chart_top">
                <el-col :span="24">
                    <br>
                    <el-card shadow="always" :style="{width:'100%',height:autoHeight+'px'}">
                            <!-- <el-row class="data_box" style="position:absolute;top:2px;right:10px;z-index:1999;">
                                    <el-date-picker
                                    v-model="search.year"
                                    type="year"
                                    value-format="yyyy"
                                    @change="showGanttMapStartTime"
                                    placeholder="开始日期">
                                    </el-date-picker>
                                    <el-radio v-model="search.type" :label="1" @change="radioChangeForLayerOne">季度</el-radio>
                                    <el-radio v-model="search.type" :label="2" @change="radioChangeForLayerOne" style="margin-left:-10px; margin-right:10px;">月份</el-radio>
                            </el-row> -->
                            <el-row>
                                <br>
                            <div id="weekBarDiv" style="width:100%;height:800px;border:0px solid red;"></div>
                            </el-row>
                    </el-card>
                </el-col>
            </el-row>
        </el-dialog>
        <el-dialog :title="dialog.dayBar.title" :visible.sync="dialog.dayBar.isShow" :close-on-click-modal="false" width="100%" top="10px"  append-to-body  v-dialogDrag>
            <el-row :gutter="10" class="chart_top">
                <el-col :span="24">
                    <br>
                    <el-card shadow="always" :style="{width:'100%',height:autoHeight+'px'}">
                            <el-row>
                                <br>
                            <div id="dayBarDiv" style="width:100%;height:800px;border:0px solid red;"></div>
                            </el-row>
                    </el-card>
                </el-col>
            </el-row>
        </el-dialog>
    </div>
</template>
<script>
import echarts from 'echarts';
import maskStatisticsApi from '@/axios/maskStatistics.js'
export default {
    data(){
        return{
            ganttChartBar:null,
            ganttChartWeekBar:null,
            ganttChartDayBar:null,
            search:{
                year:'2020',
                type:1,//1 季度 2月份
                target:1,
                week:1,
            },
            grid:{
                yAxisData:[],
                xAxisData:[],
                seriesData:[],
                seriesWeekData:[],
                seriesDayData:[],
                series:{
                    // '制片-合格品', '制片-返工品', '制片-报废品','耳带-合格品', '耳带-返工品', '耳带-报废品', '包装-合格品', '包装-返工品', '包装-报废品'
                    zpQualifiedData:[],//制片合格数据
                    edQualifiedData:[],//耳带合格数据
                    bzQualifiedData:[],//包装合格数据
                    fgQualifiedData:[],//返工合格数据
                    zpReworkData:[],//制片返工数据
                    edReworkData:[],//耳带返工数据
                    bzReworkData:[],//包装返工数据
                    fgReworkData:[],//返工返工数据
                    zpScrapData:[],//制片报废数据
                    edScrapData:[],//耳带报废数据
                    bzScrapData:[],//包装报废数据
                    fgScrapData:[],//返工报废数据
                },
                weekSeries:{
                    xAxisData:[],      //X轴数据
                    zpQualifiedData:[],//制片合格数据
                    edQualifiedData:[],//耳带合格数据
                    bzQualifiedData:[],//包装合格数据
                    fgQualifiedData:[],//返工合格数据
                    zpReworkData:[],//制片返工数据
                    edReworkData:[],//耳带返工数据
                    bzReworkData:[],//包装返工数据
                    fgReworkData:[],//返工返工数据
                    zpScrapData:[],//制片报废数据
                    edScrapData:[],//耳带报废数据
                    bzScrapData:[],//包装报废数据
                    fgScrapData:[],//返工报废数据
                },
                daySeries:{
                    xAxisData:[],      //X轴数据
                    zpQualifiedData:[],//制片合格数据
                    edQualifiedData:[],//耳带合格数据
                    bzQualifiedData:[],//包装合格数据
                    fgQualifiedData:[],//返工合格数据
                    zpReworkData:[],//制片返工数据
                    edReworkData:[],//耳带返工数据
                    bzReworkData:[],//包装返工数据
                    fgReworkData:[],//返工返工数据
                    zpScrapData:[],//制片报废数据
                    edScrapData:[],//耳带报废数据
                    bzScrapData:[],//包装报废数据
                    fgScrapData:[],//返工报废数据
                }
            },
            dialog:{
                weekBar:{
                    title:'',
                    isShow:false,
                },
                dayBar:{
                    title:'',
                    isShow:false,
                },
            }
        }
    },
    created(){
        let self = this;
        self.$nextTick(()=>{
            self.init();
        });

    },
    mounted(){
        let self = this;

    },
    computed:{
        autoHeight(){
            return this.$store.state.clientHeight-55;
        }
    },
    watch:{},
    methods:{
        //初始化
        init(){
            let self = this;
            window.self = this;
            self.initCacheData();
            self.initBarData();
        },
        //初始化缓存数据
        initCacheData(){
            let self = this;
        },
        //初始化数状统计图数据
        initBarData(){
            let self = this;
            self.setXaxisData();
            self.queryBarData();
        },
        //查询树状图数据
        queryBarData(){
            let self = this;
            let params = {
                year:self.search.year,
                type:self.search.type
            };
            maskStatisticsApi.queryBarData(params).then(res=>{
                console.log("查询的第一层柱状图的参数为");
                self.grid.seriesData = res.content;
                self.setSeriesData();
            });
        },
        //查询树状图数据
        queryWeekBarData(){
            let self = this;
            let params = {
                year:self.search.year,
                type:self.search.type,
                target:self.search.target
            };
            maskStatisticsApi.queryWeekBarData(params).then(res=>{
                self.grid.seriesWeekData = res.content;
                console.log(self.grid.seriesWeekData);
                self.setWeekSeriesData();
            });
        },
        //查询树状图数据
        queryDayBarData(){
            let self = this;
            let params = {
                year:self.search.year,
                week:self.search.week
            };
            console.log("查询参数为:");
            console.log(params);
            maskStatisticsApi.queryDayBarData(params).then(res=>{
                self.grid.seriesDayData = res.content;
                console.log(self.grid.seriesDayData);
                self.setDaySeriesData();
            });
        },
        //通过不同的第一层坐标设置数据
        setSeriesData(){
            let self = this;
            if(self.grid.seriesData!=null&&self.grid.seriesData.length!=0){
                //通过查询结果参数type判定 是季节查询还是月份查询
                    // self.grid.series.qualifiedData = [];
                    // self.grid.series.reworkData = [];
                    // self.grid.series.scrapData = [];
                     self.grid.series.zpQualifiedData =[];//制片合格数据
                     self.grid.series.edQualifiedData =[];//耳带合格数据
                     self.grid.series.bzQualifiedData =[];//包装合格数据
                     self.grid.series.fgQualifiedData =[];//包装合格数据
                     self.grid.series.zpReworkData =[];//制片返工数据
                     self.grid.series.edReworkData=[];//耳带返工数据
                     self.grid.series.bzReworkData=[];//包装返工数据
                     self.grid.series.fgReworkData=[];//包装返工数据
                     self.grid.series.zpScrapData=[];//制片报废数据
                     self.grid.series.edScrapData=[];//耳带报废数据
                     self.grid.series.bzScrapData=[];//包装报废数据
                     self.grid.series.fgScrapData=[];//返工报废数据
                if(self.search.type==1){
                    //通过季节
                        self.grid.seriesData.forEach(element => {
                            // if(element.outType==='5' ){
                            //     //合格品
                            //     self.grid.series.qualifiedData.push({
                            //         name:'合格品',
                            //         value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                            //     });
                            // }
                            // if(element.outType==='6' ){
                            //     //返工品
                            //     self.grid.series.reworkData.push({
                            //         name:'返工品',
                            //         value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                            //     });
                            // }
                            // if(element.outType==='7' ){
                            //     //报废品
                            //     self.grid.series.scrapData.push({
                            //         name:'报废品',
                            //         value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                            //     });
                            // }
                            if(element.outType==='5' ){
                                //合格品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.series.zpQualifiedData.push({
                                            name:'制片-合格品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '2':
                                        self.grid.series.edQualifiedData.push({
                                            name:'耳带-合格品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '3':
                                        self.grid.series.bzQualifiedData.push({
                                            name:'包装-合格品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '4':
                                        self.grid.series.fgQualifiedData.push({
                                            name:'返工-合格品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                            }
                            if(element.outType==='6' ){
                                //返工品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.series.zpReworkData.push({
                                            name:'制片-返工品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '2':
                                        self.grid.series.edReworkData.push({
                                            name:'耳带-返工品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '3':
                                        self.grid.series.bzReworkData.push({
                                            name:'包装-返工品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '4':
                                        self.grid.series.fgReworkData.push({
                                            name:'返工-返工品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    default:
                                        break;
                                }

                                // self.grid.series.reworkData.push({
                                //     name:'返工品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                            if(element.outType==='7' ){
                                switch (element.gx) {
                                    case '1':
                                        self.grid.series.zpScrapData.push({
                                            name:'制片-报废品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '2':
                                        self.grid.series.edScrapData.push({
                                            name:'耳带-报废品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '3':
                                        self.grid.series.bzScrapData.push({
                                            name:'包装-报废品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    case '4':
                                        self.grid.series.fgScrapData.push({
                                            name:'返工-报废品',
                                            value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.quarter)]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                                //报废品
                                // self.grid.series.zpScrapData.push({
                                //     name:'报废品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                        });
                }else
                if(self.search.type==2){
                    //通过月份
                        self.grid.seriesData.forEach(element => {
                            if(element.outType==='5' ){
                                //合格品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.series.zpQualifiedData.push({
                                            name:'制片-合格品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '2':
                                        self.grid.series.edQualifiedData.push({
                                            name:'耳带-合格品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '3':
                                        self.grid.series.bzQualifiedData.push({
                                            name:'包装-合格品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '4':
                                        self.grid.series.fgQualifiedData.push({
                                            name:'返工-合格品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                            }
                            if(element.outType==='6' ){
                                //返工品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.series.zpReworkData.push({
                                            name:'制片-返工品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '2':
                                        self.grid.series.edReworkData.push({
                                            name:'耳带-返工品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '3':
                                        self.grid.series.bzReworkData.push({
                                            name:'包装-返工品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '4':
                                        self.grid.series.fgReworkData.push({
                                            name:'返工-返工品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    default:
                                        break;
                                }

                                // self.grid.series.reworkData.push({
                                //     name:'返工品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                            if(element.outType==='7' ){
                                switch (element.gx) {
                                    case '1':
                                        self.grid.series.zpScrapData.push({
                                            name:'制片-报废品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '2':
                                        self.grid.series.edScrapData.push({
                                            name:'耳带-报废品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '3':
                                        self.grid.series.bzScrapData.push({
                                            name:'包装-报废品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    case '4':
                                        self.grid.series.fgScrapData.push({
                                            name:'返工-报废品',
                                            value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc,parseInt(element.yearMonth)]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                                //报废品
                                // self.grid.series.zpScrapData.push({
                                //     name:'报废品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                        });
                }

            }else{

            }
            self.setBarMap();
        },
        //通过不同的第一层坐标设置数据
        setWeekSeriesData(){
            let self = this;
            if(self.grid.seriesWeekData!=null
            &&self.grid.seriesWeekData!=undefined
            &&self.grid.seriesWeekData.data!=null
            &&self.grid.seriesWeekData.data!=undefined
            && self.grid.seriesWeekData.data.length!=0){
                //通过查询结果参数type判定 是季节查询还是月份查询
                    // self.grid.series.qualifiedData = [];
                    // self.grid.series.reworkData = [];
                    // self.grid.series.scrapData = [];
                     self.grid.weekSeries.xAxisData = self.grid.seriesWeekData.weeks;
                     self.grid.weekSeries.zpQualifiedData =[];//制片合格数据
                     self.grid.weekSeries.edQualifiedData =[];//耳带合格数据
                     self.grid.weekSeries.bzQualifiedData =[];//包装合格数据
                     self.grid.weekSeries.fgQualifiedData =[];//包装合格数据
                     self.grid.weekSeries.zpReworkData =[];//制片返工数据
                     self.grid.weekSeries.edReworkData=[];//耳带返工数据
                     self.grid.weekSeries.bzReworkData=[];//包装返工数据
                     self.grid.weekSeries.fgReworkData=[];//包装返工数据
                     self.grid.weekSeries.zpScrapData=[];//制片报废数据
                     self.grid.weekSeries.edScrapData=[];//耳带报废数据
                     self.grid.weekSeries.bzScrapData=[];//包装报废数据
                     self.grid.weekSeries.fgScrapData=[];//返工报废数据
                // if(self.search.type==1){
                    //通过季节
                        self.grid.seriesWeekData.data.forEach(element => {
                            if(element.outType==='5' ){
                                //合格品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.weekSeries.zpQualifiedData.push({
                                            name:'制片-合格品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '2':
                                        self.grid.weekSeries.edQualifiedData.push({
                                            name:'耳带-合格品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '3':
                                        self.grid.weekSeries.bzQualifiedData.push({
                                            name:'包装-合格品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '4':
                                        self.grid.weekSeries.fgQualifiedData.push({
                                            name:'返工-合格品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                            }
                            if(element.outType==='6' ){
                                //返工品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.weekSeries.zpReworkData.push({
                                            name:'制片-返工品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '2':
                                        self.grid.weekSeries.edReworkData.push({
                                            name:'耳带-返工品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '3':
                                        self.grid.weekSeries.bzReworkData.push({
                                            name:'包装-返工品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '4':
                                        self.grid.weekSeries.fgReworkData.push({
                                            name:'返工-返工品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    default:
                                        break;
                                }

                                // self.grid.series.reworkData.push({
                                //     name:'返工品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                            if(element.outType==='7' ){
                                switch (element.gx) {
                                    case '1':
                                        self.grid.weekSeries.zpScrapData.push({
                                            name:'制片-报废品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '2':
                                        self.grid.weekSeries.edScrapData.push({
                                            name:'耳带-报废品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '3':
                                        self.grid.weekSeries.bzScrapData.push({
                                            name:'包装-报废品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    case '4':
                                        self.grid.weekSeries.fgScrapData.push({
                                            name:'返工-报废品',
                                            value:[element.week+'',parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                                //报废品
                                // self.grid.series.zpScrapData.push({
                                //     name:'报废品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                        });
            }else{

            }
            self.setWeekBarMap();
        },
        //通过不同的第一层坐标设置数据
        setDaySeriesData(){
            let self = this;
            if(self.grid.seriesDayData!=null
            &&self.grid.seriesDayData!=undefined
            &&self.grid.seriesDayData.length!=0){
                //通过查询结果参数type判定 是季节查询还是月份查询
                    // self.grid.series.qualifiedData = [];
                    // self.grid.series.reworkData = [];
                    // self.grid.series.scrapData = [];
                     self.grid.daySeries.zpQualifiedData =[];//制片合格数据
                     self.grid.daySeries.edQualifiedData =[];//耳带合格数据
                     self.grid.daySeries.bzQualifiedData =[];//包装合格数据
                     self.grid.daySeries.fgQualifiedData =[];//包装合格数据
                     self.grid.daySeries.zpReworkData =[];//制片返工数据
                     self.grid.daySeries.edReworkData=[];//耳带返工数据
                     self.grid.daySeries.bzReworkData=[];//包装返工数据
                     self.grid.daySeries.fgReworkData=[];//包装返工数据
                     self.grid.daySeries.zpScrapData=[];//制片报废数据
                     self.grid.daySeries.edScrapData=[];//耳带报废数据
                     self.grid.daySeries.bzScrapData=[];//包装报废数据
                     self.grid.daySeries.fgScrapData=[];//返工报废数据
                // if(self.search.type==1){
                    //通过季节
                        self.grid.seriesDayData.forEach(element => {
                            if(element.outType==='5' ){
                                //合格品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.daySeries.zpQualifiedData.push({
                                            name:'制片-合格品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '2':
                                        self.grid.daySeries.edQualifiedData.push({
                                            name:'耳带-合格品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '3':
                                        self.grid.daySeries.bzQualifiedData.push({
                                            name:'包装-合格品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '4':
                                        self.grid.daySeries.fgQualifiedData.push({
                                            name:'返工-合格品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    default:
                                        break;
                                }
                            }
                            if(element.outType==='6' ){
                                //返工品
                                switch (element.gx) {
                                    case '1':
                                        self.grid.daySeries.zpReworkData.push({
                                            name:'制片-返工品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '2':
                                        self.grid.daySeries.edReworkData.push({
                                            name:'耳带-返工品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '3':
                                        self.grid.daySeries.bzReworkData.push({
                                            name:'包装-返工品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '4':
                                        self.grid.daySeries.fgReworkData.push({
                                            name:'返工-返工品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    default:
                                        break;
                                }

                                // self.grid.series.reworkData.push({
                                //     name:'返工品',
                                //     value:[self.matchXaxis(element.yearMonth),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                                // });
                            }
                            if(element.outType==='7' ){
                                switch (element.gx) {
                                    case '1':
                                        self.grid.daySeries.zpScrapData.push({
                                            name:'制片-报废品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '2':
                                        self.grid.daySeries.edScrapData.push({
                                            name:'耳带-报废品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '3':
                                        self.grid.daySeries.bzScrapData.push({
                                            name:'包装-报废品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    case '4':
                                        self.grid.daySeries.fgScrapData.push({
                                            name:'返工-报废品',
                                            value:[self.matchDayXaxis(element.currentWeek,element.dateClasses),parseInt(element.total),element.gx,element.gxName,element.outDesc,element.year,element.weekBeginTime,element.weekEndTime,element. currentDate]
                                        });
                                        break;
                                    default:
                                        break;
                                }

                            }
                        });
            }else{

            }
            self.setDayBarMap();
        },
        //matchX轴坐标
        matchXaxis(val){
            let self = this;
            let reStr = '';
            if(self.search.type==1){
                switch (val) {
                    case '1': reStr = '第一季度';break;
                    case '2': reStr = '第二季度';break;
                    case '3': reStr = '第三季度';break;
                    case '4': reStr = '第四季度';break;
                    default: reStr = '第一季度';
                        break;
                }
            }else
            if(self.search.type==2){
                switch (val) {
                    case '01': reStr = '1月';break;
                    case '02': reStr = '2月';break;
                    case '03': reStr = '3月';break;
                    case '04': reStr = '4月';break;
                    case '05': reStr = '5月';break;
                    case '06': reStr = '6月';break;
                    case '07': reStr = '7月';break;
                    case '08': reStr = '8月';break;
                    case '09': reStr = '9月';break;
                    case '10': reStr = '10月';break;
                    case '11': reStr = '11月';break;
                    case '12': reStr = '12月';break;
                    default: reStr = '1月';
                        break;
                }
            }
            return reStr;
        },
        //match day数据X轴坐标
        matchDayXaxis(week,dateClassesDesc){
            let self = this;
            let reStr = '';
                switch (week) {
                    case 1: reStr = dateClassesDesc==='1'?'周一白班':'周一夜班';break;
                    case 2: reStr = dateClassesDesc==='1'?'周二白班':'周二夜班';break;
                    case 3: reStr = dateClassesDesc==='1'?'周三白班':'周三夜班';break;
                    case 4: reStr = dateClassesDesc==='1'?'周四白班':'周四夜班';break;
                    case 5: reStr = dateClassesDesc==='1'?'周五白班':'周五夜班';break;
                    case 6: reStr = dateClassesDesc==='1'?'周六白班':'周六夜班';break;
                    case 7: reStr = dateClassesDesc==='1'?'周日白班':'周日夜班';break;
                    default: reStr = dateClassesDesc==='1'?'周一白班':'周一夜班';
                        break;
                }
            return reStr;
        },
        //设置X轴坐标
        setXaxisData(){
            // grid:{
            //     yAxisData:[],
            //     xAxisData:[],
            //     seriesData:[],
            // },
            let self = this;
            if(self.search.type==1){
                //季度
                self.grid.xAxisData=['第一季度','第二季度','第三季度','第四季度'];
            }else
            if(self.search.type==2){
                //月份
                self.grid.xAxisData= ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
            }
        },
        //设置树状图的option
        setOptionForBar(){
            let self = this;
            let option = {
                    // tooltip: {
                    //     trigger: 'axis',
                    //     axisPointer: {
                    //         type: 'cross',
                    //         crossStyle: {
                    //             color: '#999'
                    //         }
                    //     }
                    // },
                    tooltip: {
                        backgroundColor: "#F6F6F6",
                        borderWidth: 1,
                        borderColor: "rgba(0,0,0,.3)",
                        triggerOn: "mousemove",
                        confine: true,
                        enterable: true,
                        hideDelay:100,
                        transitionDuration: 0,
                        textStyle: {
                            color: "#333"
                        },
                        zIndex:2000,
                        extraCssText: 'box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.3);',
                        padding: [5, 10],
                        position: function (pos, params, dom, rect, size) {
                            return [pos[0] + 10, pos[1]];
                        },
                        // position: [10, 10],
                        formatter:self.tooltipHander
                    },
                    // toolbox: {
                    //     feature: {
                    //         dataView: {show: true, readOnly: false},
                    //         magicType: {show: true, type: ['line', 'bar']},
                    //         restore: {show: true},
                    //         saveAsImage: {show: true}
                    //     }
                    // },
                    legend: {
                        data: ['制片-合格品', '制片-返工品', '制片-报废品','耳带-合格品', '耳带-返工品', '耳带-报废品', '包装-合格品', '包装-返工品', '包装-报废品','返工-合格品', '返工-返工品', '返工-报废品']
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: self.grid.xAxisData,
                            axisPointer: {
                                type: 'shadow'
                            }
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            name: '数量',
                            axisLabel: {
                                formatter: '{value}'
                            }
                        },
                        // {
                        //     type: 'value',
                        //     name: '温度',
                        //     min: 0,
                        //     max: 25,
                        //     interval: 5,
                        //     axisLabel: {
                        //         formatter: '{value} °C'
                        //     }
                        // }
                    ],
                    series: [
                        // {
                        //     name: '合格品',
                        //     type: 'bar',
                        //     data: self.grid.series.qualifiedData
                        // },
                        // {
                        //     name: '返工品',
                        //     type: 'bar',
                        //     data: self.grid.series.reworkData

                        // },
                        // {
                        //     name: '报废品',
                        //     type: 'bar',
                        //     data: self.grid.series.scrapData
                        // },
                        {
                            name: '制片-合格品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.series.zpQualifiedData
                        },
                        {
                            name: '制片-返工品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.series.zpReworkData
                        },
                        {
                            name: '制片-报废品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.series.zpScrapData
                        },
                        {
                            name: '耳带-合格品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.series.edQualifiedData
                        },
                        {
                            name: '耳带-返工品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.series.edReworkData,
                            // markLine: {
                            //     lineStyle: {
                            //         type: 'dashed'
                            //     },
                            //     data: [
                            //         [{type: 'min'}, {type: 'max'}]
                            //     ]
                            // }
                        },
                        {
                            name: '耳带-报废品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.series.edScrapData
                        },
                        {
                            name: '包装-合格品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.series.bzQualifiedData
                        },
                        {
                            name: '包装-返工品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.series.bzReworkData
                        },
                        {
                            name: '包装-报废品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.series.bzScrapData
                        },
                        {
                            name: '返工-合格品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.series.fgQualifiedData
                        },
                        {
                            name: '返工-返工品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.series.fgReworkData
                        },
                        {
                            name: '返工-报废品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.series.fgScrapData
                        }
                        // {
                        //     name: '平均温度',
                        //     type: 'line',
                        //     yAxisIndex: 1,
                        //     data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
                        // }
                    ]
                };
            return option;
        },
        //设置树状图的option
        setOptionForWeekBar(){
            let self = this;
            let option = {
                    // tooltip: {
                    //     trigger: 'axis',
                    //     axisPointer: {
                    //         type: 'cross',
                    //         crossStyle: {
                    //             color: '#999'
                    //         }
                    //     }
                    // },
                    tooltip: {
                        backgroundColor: "#F6F6F6",
                        borderWidth: 1,
                        borderColor: "rgba(0,0,0,.3)",
                        triggerOn: "mousemove",
                        confine: true,
                        enterable: true,
                        hideDelay:100,
                        transitionDuration: 0,
                        textStyle: {
                            color: "#333"
                        },
                        zIndex:2000,
                        extraCssText: 'box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.3);',
                        padding: [5, 10],
                        position: function (pos, params, dom, rect, size) {
                            return [pos[0] + 10, pos[1]];
                        },
                        // position: [10, 10],
                        formatter:self.tooltipHanderForWeekBar
                    },
                    legend: {
                        data: ['制片-合格品', '制片-返工品', '制片-报废品','耳带-合格品', '耳带-返工品', '耳带-报废品', '包装-合格品', '包装-返工品', '包装-报废品','返工-合格品', '返工-返工品', '返工-报废品']
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: self.grid.weekSeries.xAxisData,
                            axisPointer: {
                                type: 'shadow'
                            },
                            axisLabel:{
                                formatter:function(val){
                                    return '第'+val+'周';
                                }
                            },
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            name: '数量',
                            axisLabel: {
                                formatter: '{value}'
                            }
                        },
                    ],
                    series: [

                        {
                            name: '制片-合格品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.weekSeries.zpQualifiedData
                        },
                        {
                            name: '制片-返工品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.weekSeries.zpReworkData
                        },
                        {
                            name: '制片-报废品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.weekSeries.zpScrapData
                        },
                        {
                            name: '耳带-合格品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.weekSeries.edQualifiedData
                        },
                        {
                            name: '耳带-返工品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.weekSeries.edReworkData,
                        },
                        {
                            name: '耳带-报废品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.weekSeries.edScrapData
                        },
                        {
                            name: '包装-合格品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.weekSeries.bzQualifiedData
                        },
                        {
                            name: '包装-返工品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.weekSeries.bzReworkData
                        },
                        {
                            name: '包装-报废品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.weekSeries.bzScrapData
                        },
                        {
                            name: '返工-合格品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.weekSeries.fgQualifiedData
                        },
                        {
                            name: '返工-返工品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.weekSeries.fgReworkData
                        },
                        {
                            name: '返工-报废品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.weekSeries.fgScrapData
                        }
                    ]
                };
            return option;
        },
        //设置树状图的option
        setOptionForDayBar(){
            let self = this;
            let option = {
                    // tooltip: {
                    //     trigger: 'axis',
                    //     axisPointer: {
                    //         type: 'cross',
                    //         crossStyle: {
                    //             color: '#999'
                    //         }
                    //     }
                    // },
                    tooltip: {
                        backgroundColor: "#F6F6F6",
                        borderWidth: 1,
                        borderColor: "rgba(0,0,0,.3)",
                        triggerOn: "mousemove",
                        confine: true,
                        enterable: true,
                        hideDelay:100,
                        transitionDuration: 0,
                        textStyle: {
                            color: "#333"
                        },
                        zIndex:2000,
                        extraCssText: 'box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.3);',
                        padding: [5, 10],
                        position: function (pos, params, dom, rect, size) {
                            return [pos[0] + 10, pos[1]];
                        },
                        // position: [10, 10],
                        formatter:self.tooltipHanderForDayBar
                    },
                    legend: {
                        data: ['制片-合格品', '制片-返工品', '制片-报废品','耳带-合格品', '耳带-返工品', '耳带-报废品', '包装-合格品', '包装-返工品', '包装-报废品','返工-合格品', '返工-返工品', '返工-报废品']
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: [
                                '周一白班',
                                '周一夜班',
                                '周二白班',
                                '周二夜班',
                                '周三白班',
                                '周三夜班',
                                '周四白班',
                                '周四夜班',
                                '周五白班',
                                '周五夜班',
                                '周六白班',
                                '周六夜班',
                                '周日白班',
                                '周日夜班',
                                ],
                            axisPointer: {
                                type: 'shadow'
                            }
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            name: '数量',
                            axisLabel: {
                                formatter: '{value}'
                            }
                        },
                    ],
                    series: [

                        {
                            name: '制片-合格品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.daySeries.zpQualifiedData
                        },
                        {
                            name: '制片-返工品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.daySeries.zpReworkData
                        },
                        {
                            name: '制片-报废品',
                            type: 'bar',
                            stack: '制片',
                            data: self.grid.daySeries.zpScrapData
                        },
                        {
                            name: '耳带-合格品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.daySeries.edQualifiedData
                        },
                        {
                            name: '耳带-返工品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.daySeries.edReworkData,
                        },
                        {
                            name: '耳带-报废品',
                            type: 'bar',
                            stack: '耳带',
                            data: self.grid.daySeries.edScrapData
                        },
                        {
                            name: '包装-合格品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.daySeries.bzQualifiedData
                        },
                        {
                            name: '包装-返工品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.daySeries.bzReworkData
                        },
                        {
                            name: '包装-报废品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.daySeries.bzScrapData
                        },
                        {
                            name: '返工-合格品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.daySeries.fgQualifiedData
                        },
                        {
                            name: '返工-返工品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.daySeries.fgReworkData
                        },
                        {
                            name: '返工-报废品',
                            type: 'bar',
                            stack: '包装',
                            data: self.grid.daySeries.fgScrapData
                        }
                    ]
                };
            return option;
        },
        tooltipHander(params){
            let self = this;
                    window.params = params;
                    // var res='';
                    // var operation ='&nbsp;&nbsp;<a href="javascript:void(0);"  onclick="openResponse()">实操人</a>';
                    // var detail ='&nbsp;&nbsp;<a href="javascript:void(0);"  onclick="openDeatil()">查看详情</a></br>';
                    // var operator = params.value[13]==null?"未设置":params.value[13];
                    // var realoperator = params.value[14]==null?"未设置":params.value[14];
                    // var planResultId = params.value[12];    //id
                    //     self.operator.planResultId = planResultId;
                    //     console.log("planResultId==="+self.operator.planResultId);
                    //     res = res+operation+detail;
                    // var date0 = new Date(params.value[1]);
                    // var date1 = new Date(params.value[2]);
                    // var covelVal = (date1.getTime()-date0.getTime())/1000/60;
                    // var scond = (date1.getTime()-date0.getTime())%60000;
                    //     date0 = date0.getFullYear() + "-" + (date0.getMonth() + 1)+"-"+date0.getDate()+" "+date0.getHours()+":"+date0.getMinutes()+":"+date0.getSeconds();
                    //     date1 = date1.getFullYear() + "-" + (date1.getMonth() + 1)+"-"+date1.getDate()+" "+date1.getHours()+":"+date1.getMinutes()+":"+date1.getSeconds();
                    // value:[self.matchXaxis(element.quarter),parseInt(element.total),element.gx,element.gxName,element.outDesc]
                     self.search.target = params.value[5];
                     let res = '';
                     let detail =params.value[0] +'&nbsp;&nbsp;<a href="javascript:void(0);"  onclick="openWeekDialog()">详情</a></br>';
                     res = res+detail;
                     res = res+
                    //  res =res+ "时间："+ params.value[0] + "</br>"+
                                         "数量："+params.value[1]+"</br>"+
                                         "工序: "+params.value[3]+"</br>"+
                                         "类型: "+params.value[4]+"</br>"+
                                        //  "状态："+state+"</br>"+
                                         "<hr/>";
                    return res;
        },
        tooltipHanderForWeekBar(params){
            let self = this;
                    window.params = params;
                    self.search.week = params.value[0];
                     let res = '';
                     let detail =params.value[5]+' 年第'+ params.value[0] +' 周&nbsp;&nbsp;<a href="javascript:void(0);"  onclick="openDayDialog()">详情</a></br>';
                     res = res+detail;
                     res = res+
                    //  res =res+ "时间："+ params.value[0] + "</br>"+
                                         "数量："+params.value[1]+"</br>"+
                                         "工序: "+params.value[3]+"</br>"+
                                         "类型: "+params.value[4]+"</br>"+
                                         "开始: "+params.value[6]+"</br>"+
                                         "结束: "+params.value[7]+"</br>"+
                                        //  "状态："+state+"</br>"+
                                         "<hr/>";
                    return res;
        },
        tooltipHanderForDayBar(params){
            let self = this;
                    window.params = params;
                     let res = '';
                     let detail =params.value[5]+' 年第'+ self.search.week +' 周</br>';
                     res = res+detail;
                     res = res+
                    //  res =res+ "时间："+ params.value[0] + "</br>"+
                                         "日期："+params.value[8]+"</br>"+
                                         "数量："+params.value[1]+"</br>"+
                                         "工序: "+params.value[3]+"</br>"+
                                         "类型: "+params.value[4]+"</br>"+
                                        //  "开始: "+params.value[6]+"</br>"+
                                        //  "结束: "+params.value[7]+"</br>"+
                                        //  "状态："+state+"</br>"+
                                         "<hr/>";
                    return res;
        },
        //生成柱状图
        setBarMap(){
            let self = this;
            let echarts = self.$echarts;
            self.ganttChartBar = echarts.init(
                document.getElementById("barDiv")
            );
            self.ganttChartBar.clear(); //清除上次数据
            let option = self.setOptionForBar();
            self.ganttChartBar.setOption(option,true);
            // if(self.isfristBindEvent){
            //     self.listenerForClikcGanttMap();
            //     self.isfristBindEvent = false;
            // }
        },
        //生成layer2 [weekBar]柱状图
        setWeekBarMap(){
            let self = this;
            let echarts = self.$echarts;
            debugger;
            let weeBarDiv = document.getElementById("weekBarDiv");
            self.ganttChartWeekBar = echarts.init(
                weeBarDiv
            );
            self.ganttChartWeekBar.clear(); //清除上次数据
            let option = self.setOptionForWeekBar();
            self.ganttChartWeekBar.setOption(option,true);
            // if(self.isfristBindEvent){
            //     self.listenerForClikcGanttMap();
            //     self.isfristBindEvent = false;
            // }
        },
        //生成layer3 [dayBar]柱状图
        setDayBarMap(){
            let self = this;
            let echarts = self.$echarts;
            debugger;
            let dayBarDiv = document.getElementById("dayBarDiv");
            self.ganttChartDayBar = echarts.init(
                dayBarDiv
            );
            self.ganttChartDayBar.clear(); //清除上次数据
            let option = self.setOptionForDayBar();
            self.ganttChartDayBar.setOption(option,true);
            // if(self.isfristBindEvent){
            //     self.listenerForClikcGanttMap();
            //     self.isfristBindEvent = false;
            // }
        },
        //日期【年份】选择处理函数
        showGanttMapStartTime(year){
            let self  = this;
            console.log(year);
            self.queryBarData();
        },
        radioChangeForLayerOne(val){
            let self = this;
            self.setXaxisData();
            self.queryBarData();

            console.log('radioChangeForLayerOne :'+val);
        },

    },

}
window.openWeekDialog = function (){
    window.self.dialog.weekBar.isShow = true;
    window.self.queryWeekBarData();
};
window.openDayDialog = function (){
    window.self.dialog.dayBar.isShow = true;
    window.self.queryDayBarData();
};
</script>
<style scoped>
.el-dialog__wrapper{
    z-index: 99999999999!important;
}
</style>
